<?php
/**
 * Project: AIGC
 * Author: moufer <moufer@163.com>
 * Date: 2024/7/6 00:43
 */

use app\middleware\{AuthTokenMiddleware, PermissionMiddleware};
use think\facade\Route;

//需要权限验证的
Route::group('admin', function () {
    Route::get('config$', '\module\ai\controller\admin\Config@options');
    Route::post('config$', '\module\ai\controller\admin\Config@submit');

    Route::get('channel/platform', '\module\ai\controller\admin\Channel@platform');
    Route::resource('channel', '\module\ai\controller\admin\Channel');
    Route::get('key/platform', '\module\ai\controller\admin\Key@platform');
    Route::resource('key', '\module\ai\controller\admin\Key');
})->middleware([
    AuthTokenMiddleware::class, // 登录校验
    PermissionMiddleware::class // 权限校验
]);